﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace E.Tool
{
    public abstract class UIBase : MonoBehaviour
    {
        public UIType type;

        public bool IsEnable
        {
            get => gameObject.activeSelf;
        }

        public virtual void Enable()
        {
            gameObject.SetActive(true);
            //Debug.Log("隐藏UI：" + type.ToString());
        }
        public virtual void Disable()
        {
            gameObject.SetActive(false);
            //Debug.Log("显示UI：" + type.ToString());
        }

        public abstract void Init();
    }

    public enum UIType
    {
        None = 0,
        //大厅内菜单
        Lobby = 1,
        //加载页面
        Loading = 2,
        //游戏内菜单
        InGameMenu = 3,

        //大厅和游戏内共用
        Save = 4,
        Setting = 5,
        Author = 6,
        Popup = 7,

        //游戏内专用
        HUD = 10,
        Option = 12,
        OperationTip = 13,
        Story = 14
    }
}
